﻿//------------------------------------------------------------
// AureFramework
// Developed By Drunk Fish
// GitHub: https://github.com/YYYurz
// Gitee: https://gitee.com/yyyurz
//------------------------------------------------------------

using System;

namespace AureFramework.Entity
{
	public interface IEntityModule
	{
		/// <summary>
		/// 获取实体组
		/// </summary>
		/// <param name="groupName">实体组名称</param>
		/// <returns></returns>
		IEntityGroup GetEntityGroup(string groupName);

		/// <summary>
		/// 获取所有实体组
		/// </summary>
		/// <returns></returns>
		IEntityGroup[] GetAllEntityGroups();

		/// <summary>
		/// 获取实体
		/// </summary>
		/// <param name="entityId">实体Id</param>
		/// <returns></returns>
		EntityLogic GetEntity(int entityId);

		/// <summary>
		/// 预加载实体
		/// </summary>
		/// <param name="entityAssetName"></param>
		/// <param name="groupName"></param>
		/// <param name="callback"></param>
		void PreloadEntity<T>(string entityAssetName, string groupName, Action<bool> callback = null);

		/// <summary>
		/// 预加载实体
		/// </summary>
		/// <param name="entityLogicType"></param>
		/// <param name="entityAssetName"></param>
		/// <param name="groupName"></param>
		/// <param name="callback"></param>
		void PreloadEntity(Type entityLogicType, string entityAssetName, string groupName, Action<bool> callback);

		/// <summary>
		/// 显示实体
		/// </summary>
		/// <param name="entityAssetName">实体资源名称</param>
		/// <param name="groupName">实体组名称</param>
		/// <param name="userData">用户自定义数据</param>
		/// <returns></returns>
		int ShowEntity<T>(string entityAssetName, string groupName, object userData = null);

		/// <summary>
		/// 显示实体
		/// </summary>
		/// <param name="entityLogicType">实体逻辑类</param>
		/// <param name="entityAssetName">实体资源名称</param>
		/// <param name="groupName">实体组名称</param>
		/// <param name="userData">用户自定义数据</param>
		/// <returns></returns>
		int ShowEntity(Type entityLogicType, string entityAssetName, string groupName, object userData = null);

		/// <summary>
		/// 隐藏实体
		/// </summary>
		/// <param name="entityLogic">实体</param>
		void HideEntity(EntityLogic entityLogic);
		
		/// <summary>
		/// 隐藏实体
		/// </summary>
		/// <param name="entityId">实体Id</param>
		void HideEntity(int entityId);

		/// <summary>
		/// 隐藏所有实体
		/// </summary>
		void HideAllEntities();
	}
}